import {defineConfig} from 'vitepress';
import DefineOptions from 'unplugin-vue-define-options/vite'

export default defineConfig({
    title: 'Ying UI',
    description: '这是我的第一个 VuePress 站点',
    base: './',
    themeConfig: {
        algolia: {
            apiKey: '',
            indexName: ''
        },
        nav: [
            {
                text: '组件',
                link: '/components/draggable'
            }
        ],
        sidebar: {
            '/components': [
                {
                    text: '按钮 Button',
                    link: '/components/button'
                },
                {
                    text: '拖动组件 Draggable',
                    link: '/components/draggable'
                }
            ]
        }
    },
    head: [
        ['script', {src: ''}]
    ],
    vite: {
        plugins: [DefineOptions()]
    },
    markdown: {
        // options for markdown-it-anchor
        anchor: { permalink: false },

        // options for markdown-it-toc
        toc: { includeLevel: [1, 2] },
        config: (md) => {
            const { demoBlockPlugin } = require('vitepress-theme-demoblock')
            md.use(demoBlockPlugin, {
                cssPreprocessor: 'less'
            })
        }
    }
})